feat(dev): add integration scaffolder#2685
Open
PascalThuet wants to merge 7 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a developer-facing integration scaffolding feature to generate built-in integration packages plus a matching test skeleton, exposed via a new specify dev integration scaffold CLI command and documented for contributors.
Changes:
- Introduces
scaffold_integration()and templates for multiple integration types (markdown/toml/yaml/skills). - Adds
specify dev integration scaffoldTyper command to generate scaffold files and print next steps. - Adds integration tests validating generated file contents and error cases; updates local development docs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/integrations/test_integration_scaffold.py | New integration tests covering CLI scaffold behavior, templates, and validation errors. |
| src/specify_cli/integration_scaffold.py | New scaffold implementation: templates, content generation, filesystem writes, and result metadata. |
| src/specify_cli/init.py | Adds new dev integration scaffold CLI command wiring around scaffold_integration(). |
| docs/local-development.md | Documents how to run the new scaffold command and renumbers subsequent sections. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
requested changes
Jun 3, 2026
mnriem
left a comment
Collaborator
There was a problem hiding this comment.
Please address Copilot feedback
Collaborator
|
Please address Copilot feedback |
cdf7c79 to
d6eed85
Compare
Collaborator
|
Please address Copilot feedback |
Comment on lines
+659
to
+663
| try: | ||
| result = scaffold_integration(project_root, key, integration_type) | ||
| except (FileExistsError, ValueError) as exc: | ||
| console.print(f"[red]Error:[/red] {exc}") | ||
| raise typer.Exit(1) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The scaffold template emitted `multi_install_safe = True` alongside a placeholder `context_file = "AGENTS.md"`. Registered as-is, that violates the registry contract (test_safe_integrations_have_distinct_context_files): codex already pairs AGENTS.md with multi_install_safe = True, so the generated boilerplate would collide on first registration. Default the scaffold to False (matching IntegrationBase) so generated code is registry-test-friendly out of the box; contributors opt in once they pick a unique context_file. Aligns the generated test skeleton and both scaffold tests, which previously contradicted each other (one expected True, one False). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Guard scaffold_integration() against symlinked target directories: walk each path component under the repo root and refuse symlinked dirs, then confirm the write destination resolves inside the repo (mirrors the manifest directory guard). Prevents scaffolding outside the repo when a contributor's integrations/tests path is symlinked. - Make the `--type` click.Choice case-insensitive so `--type YAML` is accepted, matching scaffold_integration()'s strip()/lower() normalization instead of rejecting at the CLI layer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The `dev integration scaffold` command only caught FileExistsError/ValueError, so an OSError raised during mkdir()/write_text() (permission denied, read-only checkout, a path component that is a file, ...) bubbled up as a traceback instead of a clean error + exit code. Broaden the handler to OSError (which also covers FileExistsError) and add coverage for the filesystem-error path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e1dbd1e to
ff11bf1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2683.
Summary
specify dev integration scaffold <key>for built-in integration boilerplateTesting
uv run --extra test pytest tests/integrations/test_integration_scaffold.py -vuv run --extra test pytest tests/integrations/test_integration_scaffold.py tests/integrations/test_registry.py -vuvx ruff check src/specify_cli/integration_scaffold.py src/specify_cli/__init__.py tests/integrations/test_integration_scaffold.pygit diff --check